import { Injectable } from '@nestjs/common';
import * as svgCaptcha from 'svg-captcha';

@Injectable()
export class CaptchaService {
  async captcha(width = 100, height = 32) {
    return svgCaptcha.createMathExpr({
      fontSize: 40,
      width: width,
      height: height,
      color: true,
      background: '#cc9966',
      noise: 2,
    });
  }
}
